<?php
class InPaymentData {
    protected $patientId      =   ''; // Patient Id
	protected $insuranceType  =   ''; // Insurance type
    protected $originalPrice  =   0; // Total price
    protected $insurancePrice =   0; // Total amount Insurance Agent must pay to hospital
    protected $patientPrice   =   0; // Total amount patient must pay to hospital

    public function __construct($orgPrice=0, $insPrice=0, $patPrice=0) {
        $this->originalPrice    =   $orgPrice;
        $this->insurancePrice   =   $insPrice;
        $this->patientPrice     =   $patPrice;
    }

    public function getInsuranceType() {
    	return $this->insuranceType;
    }

    public function getOriginalPrice($localized=false) {
    	if ($localized) {
    		return L10nHelper::renderNumber($this->originalPrice);
    	}
    	return $this->originalPrice;
    }

    public function getPatientPrice($localized=false) {
        if ($localized) {
            return L10nHelper::renderNumber($this->patientPrice);
        }
    	return $this->patientPrice;
    }

    public function getInsurancePrice($localized=false) {
        if ($localized) {
            return L10nHelper::renderNumber($this->insurancePrice);
        }
    	return $this->insurancePrice;
    }

    public function getPatientId() {
    	return $this->patientId;
    }

    public function addDataFromObject($obj){
        $this->originalPrice    +=  $obj->originalPrice;
        $this->patientPrice     +=  $obj->patientPrice;
        $this->insurancePrice   +=  $obj->insurancePrice;
    }

    public function copyFromObject($obj){
        $this->originalPrice    =  $obj->getOriginalPrice();
        $this->patientPrice     =  $obj->getPatientPrice();
        $this->insurancePrice   =  $obj->getInsurancePrice();
        $this->insuranceType    =  $obj->getInsuranceType();
        $this->patientId        =  $obj->getPatientId();
    }

    public function setOrignalPrice($val){
    	$this->originalPrice   =   $val;
    }

    public function setInsurancePrice($val){
        $this->insurancePrice   =   $val;
    }

    public function setPatientPrice($val){
        $this->patientPrice   =   $val;
    }

    public function setPatientId($id) {
        $this->patientId    =   $id;
    }

    public function setInsuranceType($type){
    	$this->insuranceType   =   $type;
    }
}
?>